<template>
  <a-card :loading="loading" :bordered="false" :body-style="{ padding: '0' }">
    <div class="salesCard" style="display:flex;">
      <div style="flex:1;">
        <a-tabs default-active-key="1" size="large" :tab-bar-style="{ marginBottom: '24px', paddingLeft: '16px' }" @change="changeTab">
          <template #rightExtra>
  <!--          <div class="extra-wrapper">
              <div class="extra-item">
                <a>今日</a>
                <a>本周</a>
                <a>本月</a>
                <a>本年</a>
              </div>
              <a-range-picker :style="{ width: '256px' }" />
            </div>-->
          </template>
        
          <a-tab-pane loading="true" tab="收款" key="1">
            <a-row>
              <a-col :xl="24" :lg="12" :md="12" :sm="24" :xs="24">
                <Bar :chartData="barData" :option="{ title: { text: '今年月收款', textStyle: { fontWeight: 'lighter' } } }" height="40vh" />
              </a-col>
              <!-- <a-col :xl="8" :lg="12" :md="12" :sm="24" :xs="24">
                <QuickNav  class="enter-y" :bordered="false" :body-style="{ padding: 0 }" />
              </a-col> -->
            </a-row>
          </a-tab-pane>

          <a-tab-pane loading="true" tab="欠款"  key="2">
            <a-row>
              <a-col :xl="24" :lg="12" :md="12" :sm="24" :xs="24">
                <Bar :chartData="barData1" :option="{ title: { text: '今年月欠款', textStyle: { fontWeight: 'lighter' } } }" height="40vh" />
              </a-col>
              <!-- <a-col :xl="8" :lg="12" :md="12" :sm="24" :xs="24">
                <QuickNav  :changeNavArr="changeNavArr" :loading="loading" class="enter-y" :bordered="false" :body-style="{ padding: 0 }" />
              </a-col> -->
            </a-row>
          </a-tab-pane>
          <!--      <a-tab-pane tab="存储监管" key="3">
                <a-row>
                  <a-col :xl="16" :lg="12" :md="12" :sm="24" :xs="24" style="display: flex">
                    <Gauge :chartData="{ name: 'C盘', value: 70 }" height="30vh"></Gauge>
                    <Gauge :chartData="{ name: 'D盘', value: 50 }" height="30vh"></Gauge>
                  </a-col>
                  <a-col :xl="8" :lg="12" :md="12" :sm="24" :xs="24">
                    <QuickNav :loading="loading" class="enter-y" :bordered="false" :body-style="{ padding: 0 }" />
                  </a-col>
                </a-row>
              </a-tab-pane>-->
        </a-tabs>
      </div>
      <div style="padding: 0 16px;">
        <QuickNav  :changeNavArr="changeNavArr" :loading="loading" class="enter-y" :bordered="false" :body-style="{ padding: 0 }" />
      </div>
    </div>
  </a-card>
</template>
<script lang="ts" setup>
  import { ref,defineEmits  } from 'vue';
  import Bar from '/@/components/chart/Bar.vue';
  import BarMulti from '/@/components/chart/BarMulti.vue';
  import Gauge from '/@/components/chart/Gauge.vue';
  import QuickNav from './QuickNav.vue';
  import {defHttp} from "/@/utils/http/axios";

  defineProps({
    loading: {
      type: Boolean,
    },
  });


  const rankList = [];
  for (let i = 0; i < 7; i++) {
    rankList.push({
      name: '白鹭岛 ' + (i + 1) + ' 号店',
      total: 1234.56 - i * 100,
    });
  }

  const barData = ref([]);
  let params={};
  const res = defHttp.get({url:"/assets.dashboard/analyse/index5",params});
  res.then((data)=>{
    console.log(data)
    barData.value=data;
  });

  const barData1 = ref([]);
  const res1 = defHttp.get({url:"/assets.dashboard/analyse/index6",params});
  res1.then((data)=>{
    console.log(data)
    barData1.value=data;
  });

</script>

<style lang="less" scoped>
  .extra-wrapper {
    line-height: 55px;
    padding-right: 24px;

    .extra-item {
      display: inline-block;
      margin-right: 24px;

      a {
        margin-left: 24px;
      }
    }
  }
</style>
